<template>
	<view>
		<block v-for="(item, index) in allDailyTaskList" :key="index">
			<my-clock-in :item="item" ></my-clock-in>
		</block>
		<!-- <block v-for="(item, index) in allDailyTaskList" :key="index"> -->
			<!-- <my-clock-in :item="allDailyTaskList[0]"></my-clock-in> -->
		<!-- </block> -->
	</view>
</template>

<script>
import myClockIn from '../../../component/myClockIn.vue';
import moment from 'moment';
moment.locale('zh-cn');
export default {
	components: {
		myClockIn
	},
	data() {
		return {
			allDailyTaskList:[],//我的所有打卡
			hasMore: true, //是否还有更多数据
			params: {
				//获取更多的参数
				limit: 10,
				skip: 0
			}
		};
	},
	mounted() {
	  this.getMineClock();
	},
	methods: {
		getMineClock() {
			//查找我的所有打卡
			this.request({
				url: this.apiServer + '/task/findMyDailyTaskByUId?uId=' + uni.getStorageSync('user').id
				+ '&limit=' + this.params.limit + 
				'&skip=' + this.params.skip
			}).then(res => {
				console.log(res);
				//res.data.createTime = moment(res.data.createTime).format('YYYY-MM-DD HH:mm:ss');
				res.data.forEach(v=>{
					v => {
						v.cnTime = moment(v.createTime).format('YYYY-MM-DD HH:mm:ss');
					}
				})
                this.allDailyTaskList = res.data; //拼接list
				console.log(this.allDailyTaskList);
			});
		}
	}
};
</script>

<style >
</style>
